// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** addArticle POST /api/article/addArticle */
export async function addArticleUsingPost(
  body: API.AddArticleDto,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsestring>('/api/article/addArticle', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** articleList GET /api/article/articleList */
export async function articleListUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.articleListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageVo>('/api/article/articleList', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** cancelTop POST /api/article/cancelTop */
export async function cancelTopUsingPost(
  body: API.ArticleTopRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsestring>('/api/article/cancelTop', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteArticle POST /api/article/delete */
export async function deleteArticleUsingPost(
  body: API.ArticleDeleteRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/article/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** getArticleDetail GET /api/article/getArticleDetail */
export async function getArticleDetailUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getArticleDetailUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseArticleDetailVo>('/api/article/getArticleDetail', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** getAuthorInfo GET /api/article/getAuthorInfo */
export async function getAuthorInfoUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getAuthorInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseAuthorVO>('/api/article/getAuthorInfo', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** getDraft GET /api/article/getDraft */
export async function getDraftUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getDraftUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageVo>('/api/article/getDraft', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** getPublic GET /api/article/getPublic */
export async function getPublicUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getPublicUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageVo>('/api/article/getPublic', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** hotArticleList GET /api/article/hotArticleList */
export async function hotArticleListUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseListHotArticleVo>('/api/article/hotArticleList', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    ...(options || {}),
  });
}

/** likeArticle POST /api/article/like */
export async function likeArticleUsingPost(
  body: API.ArticleLikeRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsestring>('/api/article/like', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** listAllArticle GET /api/article/listAllArticle */
export async function listAllArticleUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listAllArticleUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageVo>('/api/article/listAllArticle', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** topArticle POST /api/article/top */
export async function topArticleUsingPost(
  body: API.ArticleTopRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsestring>('/api/article/top', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** updateArticle POST /api/article/update */
export async function updateArticleUsingPost(
  body: API.ArticleUpdateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/article/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}
